package com.example.MyRESTAssured.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class GetResponseDataController {

    @RequestMapping(value = "/title",method = RequestMethod.GET )
    @ResponseBody
    public String validateUrl2UrlGetRequest(int page){

        String res=" {\n" +
                "     \"title\" : \"My Title\",\n" +
                "      \"_links\": {\n" +
                "              \"self\": { \"href\": \"/title?page="+page+"\" },\n" +
                "              \"next\": { \"href\": \"/title?page="+(page+1)+"\" }\n" +
                "           }\n" +
                " }";
        return res;
    }

}
